/*
 $Id: spell.c,v 1.2 2005/06/05 11:23:09 olivier Exp $
 +----------------------------------------------------------------------+
 | Copyright : mFactories 2001, 2005 
 +----------------------------------------------------------------------+
 | Projet : DataStructure
 +----------------------------------------------------------------------+
 | $Source: /cvs/DataStructure/DataStructureLib/src/spell/spell.c,v $
 | $Author: olivier $
 | $Date: 2005/06/05 11:23:09 $
 | $Revision: 1.2 $ 
 +----------------------------------------------------------------------+
 | Description :                                              
                          
 +----------------------------------------------------------------------+
 | Historique :
 $Log: spell.c,v $
 Revision 1.2  2005/06/05 11:23:09  olivier
 - Correction pour gcc

 Revision 1.1  2005/05/20 22:33:45  olivier
 Explosion des sources : 1 fichier = 1 fonction


 +----------------------------------------------------------------------+
*/

/**
 * Inclusions standards
 */
#include <ukapi.h>

/**
 * Inclusions locales
 */
#include "search.h"
#include "spell.h"

/**
 * Fonctions externes
 */
extern int spell_internal_compare_str( const pointer_t str1, const pointer_t str2 );

int spell( string_ascii_t * dictionnaire, size_t nb_mots, const string_ascii_t mot )
{
	/* Recherche le mot. */
	if ( binary_search( dictionnaire, mot, nb_mots, SPELL_SIZE, spell_internal_compare_str ) >= 0 )
	{
		return 1;
	}
	else
	{
		return 0; 
	}
}
